package com.hotelManagerSystem.service.impl;

import com.hotelManagerSystem.model.Role;
import com.hotelManagerSystem.model.StaffRole;
import com.hotelManagerSystem.mapper.StaffRoleMapper;
import com.hotelManagerSystem.service.IStaffRoleService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  职工——角色服务实现类
 * </p>
 *
 * @author longyajr
 * @since 2021-12-22
 */
@Service
public class StaffRoleServiceImpl extends ServiceImpl<StaffRoleMapper, StaffRole> implements IStaffRoleService {
    @Autowired
    private StaffRoleMapper staffRoleMapper;

    @Override
    public Boolean deleteStaffRoleByStaffId(int staffId) {
        return staffRoleMapper.deleteStaffRoleByStaffId(staffId);
    }

    @Override
    public Boolean deleteStaffRoleByRoleId(int roleId) {
        return staffRoleMapper.deleteStaffRoleByRoleId(roleId);
    }

    /**
     * @author treasy
     * @param staffId
     * @return
     */
    @Override
    public List<Role> queryAllRoleByStaffId(int staffId) {
        return staffRoleMapper.queryAllRoleByStaffId(staffId);
    }
}
